from django.db import models
from op_drf.base import BaseModel
from apps.DispenProduct.models import DispenProduct

# Create your models here.
class DispenAdvantage(BaseModel):
    '''
    智能摆药的优势
    '''
    title = models.CharField(max_length=100,verbose_name="标题",help_text="标题",default="")
    advantage = models.TextField(verbose_name="优势", help_text="优势")
    detail = models.TextField(verbose_name="内容",help_text="内容")

    # img = models.CharField(max_length=200, default="", verbose_name="图片地址", help_text="图片地址")

    class Meta:
        db_table = "yc_dispenadvantage"
        verbose_name = "摆药产品优势"
        verbose_name_plural = verbose_name


class Dispentage(BaseModel):
    '''
    智能摆药的标签tag
    '''

    advantage = models.ForeignKey(DispenAdvantage,on_delete=models.CASCADE,verbose_name="优势",help_text="优势")
    tags = models.CharField(max_length=20, default="", verbose_name="名称",help_text="名称")
    url = models.CharField(max_length=20, default="",verbose_name="超链接",help_text="超链接")
    title = models.CharField(max_length=20,default="",verbose_name="标题",help_text="标题")

    class Meta:
        db_table = "yc_dispentage"
        verbose_name = "摆药产品标签"
        verbose_name_plural = verbose_name


class DispenPicture(BaseModel):
    '''
    智能摆药的图片
    '''
    advantage = models.ForeignKey(DispenAdvantage, on_delete=models.CASCADE, verbose_name="优势", help_text="优势")
    img = models.CharField(max_length=200, default="", verbose_name="图片地址", help_text="图片地址")
    title = models.CharField(max_length=20, default="", verbose_name="标题", help_text="标题")

    class Meta:
        db_table = "yc_dispenpicture"
        verbose_name = "摆药产品图片"
        verbose_name_plural = verbose_name
